package com.sparrow.example_message.base.resp;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.*;

import com.sparrow.example_message.base.resp.RespLoginPacket;

import java.util.*;

import com.baidu.bjf.remoting.protobuf.FieldType;

import com.baidu.bjf.remoting.protobuf.utils.*;

import com.google.protobuf.*;

import java.io.IOException;

import java.lang.reflect.*;

import com.baidu.bjf.remoting.protobuf.code.*;


public class RespLoginPacket$$JProtoBufClass implements com.baidu.bjf.remoting.protobuf.Codec<com.sparrow.example_message.base.resp.RespLoginPacket>, Serializable {
	public static final long serialVersionUID = 1L;
    private com.google.protobuf.Descriptors.Descriptor descriptor;

    public byte[] encode(com.sparrow.example_message.base.resp.RespLoginPacket t) throws IOException {
        CodecOutputByteArray output = CodecOutputByteArray.get();
        doWriteTo(t, output.getCodedOutputStream());
        return output.getData();
    }

    public com.sparrow.example_message.base.resp.RespLoginPacket decode(byte[] bb) throws IOException {
        CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length);
        return readFrom(input);
    }

    public int size(com.sparrow.example_message.base.resp.RespLoginPacket t) throws IOException {
        int size = 0;
        
        Long f_1 = null;
        if (!CodedConstant.isNull(t.getPlayerId())) {
            f_1 = t.getPlayerId();  
            size += com.google.protobuf.CodedOutputStream.computeInt64Size(1,f_1.longValue());

        }
        
        
        String f_2 = null;
        if (!CodedConstant.isNull(t.getName())) {
            f_2 = t.getName();  
            size += com.google.protobuf.CodedOutputStream.computeStringSize(2,f_2);

        }
        
        
        Integer f_3 = null;
        if (!CodedConstant.isNull(t.getLevel())) {
            f_3 = t.getLevel();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(3,f_3.intValue());

        }
        
        
        Integer f_4 = null;
        if (!CodedConstant.isNull(t.getExp())) {
            f_4 = t.getExp();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(4,f_4.intValue());

        }
        
        
        Long f_5 = null;
        if (!CodedConstant.isNull(t.getFight())) {
            f_5 = t.getFight();  
            size += com.google.protobuf.CodedOutputStream.computeInt64Size(5,f_5.longValue());

        }
        
        
        Integer f_6 = null;
        if (!CodedConstant.isNull(t.getSceneId())) {
            f_6 = t.getSceneId();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(6,f_6.intValue());

        }
        
        
        Map f_7 = null;
        if (!CodedConstant.isNull(t.getAttrMap())) {
            f_7 = t.getAttrMap();  
            size += CodedConstant.computeMapSize(7, f_7, com.google.protobuf.WireFormat.FieldType.INT32,0,com.google.protobuf.WireFormat.FieldType.INT64,0L);

        }
        
        
        Integer f_8 = null;
        if (!CodedConstant.isNull(t.getHp())) {
            f_8 = t.getHp();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(8,f_8.intValue());

        }
        
        
        Integer f_9 = null;
        if (!CodedConstant.isNull(t.getMaxHp())) {
            f_9 = t.getMaxHp();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(9,f_9.intValue());

        }
        
        
        return size;
    }
 
    public void doWriteTo(com.sparrow.example_message.base.resp.RespLoginPacket t, CodedOutputStream output)
            throws IOException {
         
        Long f_1 = null;
        if (!CodedConstant.isNull(t.getPlayerId())) {
            f_1 = t.getPlayerId();
            if (f_1 != null){
output.writeInt64(1, f_1.longValue());
}
  
        }
        
        String f_2 = null;
        if (!CodedConstant.isNull(t.getName())) {
            f_2 = t.getName();
            if (f_2 != null){
output.writeString(2, f_2);
}
  
        }
        
        Integer f_3 = null;
        if (!CodedConstant.isNull(t.getLevel())) {
            f_3 = t.getLevel();
            if (f_3 != null){
output.writeInt32(3, f_3.intValue());
}
  
        }
        
        Integer f_4 = null;
        if (!CodedConstant.isNull(t.getExp())) {
            f_4 = t.getExp();
            if (f_4 != null){
output.writeInt32(4, f_4.intValue());
}
  
        }
        
        Long f_5 = null;
        if (!CodedConstant.isNull(t.getFight())) {
            f_5 = t.getFight();
            if (f_5 != null){
output.writeInt64(5, f_5.longValue());
}
  
        }
        
        Integer f_6 = null;
        if (!CodedConstant.isNull(t.getSceneId())) {
            f_6 = t.getSceneId();
            if (f_6 != null){
output.writeInt32(6, f_6.intValue());
}
  
        }
        
        Map f_7 = null;
        if (!CodedConstant.isNull(t.getAttrMap())) {
            f_7 = t.getAttrMap();
            if (f_7 != null){
CodedConstant.writeToMap(output,7,f_7,com.google.protobuf.WireFormat.FieldType.INT32,0,com.google.protobuf.WireFormat.FieldType.INT64,0L);
}
  
        }
        
        Integer f_8 = null;
        if (!CodedConstant.isNull(t.getHp())) {
            f_8 = t.getHp();
            if (f_8 != null){
output.writeInt32(8, f_8.intValue());
}
  
        }
        
        Integer f_9 = null;
        if (!CodedConstant.isNull(t.getMaxHp())) {
            f_9 = t.getMaxHp();
            if (f_9 != null){
output.writeInt32(9, f_9.intValue());
}
  
        }
        
    }            
 
    public void writeTo(com.sparrow.example_message.base.resp.RespLoginPacket t, CodedOutputStream output)
            throws IOException {
        doWriteTo(t, output);
    }
 
    public com.sparrow.example_message.base.resp.RespLoginPacket readFrom(CodedInputStream input) throws IOException {
        com.sparrow.example_message.base.resp.RespLoginPacket ret = new com.sparrow.example_message.base.resp.RespLoginPacket();
        
        ret.setAttrMap(new HashMap())
;


        
        try {
            boolean done = false;
            Codec codec = null;
            while (!done) {
                int tag = input.readTag();
                if (tag == 0) {
                    break;
                }
                
                if (tag == 8) {
                    
                    ret.setPlayerId(input.readInt64())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 18) {
                    
                    ret.setName(input.readString())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 24) {
                    
                    ret.setLevel(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 32) {
                    
                    ret.setExp(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 40) {
                    
                    ret.setFight(input.readInt64())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 48) {
                    
                    ret.setSceneId(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 58) {
                    
                    if ((ret.getAttrMap()) == null) {
Map __map = new HashMap();
ret.setAttrMap(__map);
}
CodedConstant.putMapValue(input, (Map<java.lang.Integer, java.lang.Long>)ret.getAttrMap(),com.google.protobuf.WireFormat.FieldType.INT32,0,com.google.protobuf.WireFormat.FieldType.INT64,0L, null, null);

                    
                    
                    continue;
                }
                
                
                if (tag == 64) {
                    
                    ret.setHp(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 72) {
                    
                    ret.setMaxHp(input.readInt32())
;

                    
                    
                    continue;
                }
                
                               
                
                input.skipField(tag);
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e;
        } catch (java.io.IOException e) {
            throw e;
        }

        return ret;       
        
    } 
 
 
     public com.google.protobuf.Descriptors.Descriptor getDescriptor() throws IOException {
        if (this.descriptor != null) {
            return this.descriptor;
        }
        com.google.protobuf.Descriptors.Descriptor descriptor =
                CodedConstant.getDescriptor(com.sparrow.example_message.base.resp.RespLoginPacket.class);
        return (this.descriptor = descriptor);
    }   
}

    